import { formatTime  } from '@/utils'
import i18n from '@/locales/index' 
const { t } = i18n.global
export const normalColumns =  [
  {
    title: t('common.sequenceNo'), dataIndex: 'index', key: 'index', align: 'center', width: 60,
    customRender: ({ index }) => {
      return index + 1
    }
  },
  { title: t('deviceManage.roleId'), dataIndex: 'code', key: 'code', align: 'center' },
  { title: t('deviceManage.roleName'), dataIndex: 'name', key: 'name', align: 'center' },
  { title: t('sysManage.funPower'), dataIndex: 'dataScope', key: 'dataScope', align: 'center' },
  {
    title: t('common.createTime'), dataIndex: 'createTime', key: 'createTime', align: 'center', timeType: 'time',
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  {
    title: t('common.updateTime'), dataIndex: 'updateTime', key: 'updateTime', align: 'center', timeType: 'time',
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  { title: t('common.operate'), dataIndex: 'operate', key: 'operate', align: 'center', width: 170, fixed: 'right' }
]

export const localColumns =  [
  {
    title: t('common.sequenceNo'), dataIndex: 'index', key: 'index', align: 'center', width: 60,
    customRender: ({ index }) => {
      return index + 1
    }
  },
  { title: t('deviceManage.roleId'), dataIndex: 'code', key: 'code', align: 'center' },
  { title: t('deviceManage.roleName'), dataIndex: 'name', key: 'name', align: 'center' },
  { title: t('sysManage.funPower'), dataIndex: 'dataScope', key: 'dataScope', align: 'center' },
  {
    title: t('common.createTime'), dataIndex: 'createTime', key: 'createTime', align: 'center', timeType: 'time',
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  {
    title: t('common.updateTime'), dataIndex: 'updateTime', key: 'updateTime', align: 'center', timeType: 'time',
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  }
]